﻿
// 2024/2/26: 首个版本
// 2024/7/3: 基于新样本框架
// 2025/8/4: 不使用cat宏

#ifndef WALKER_CONTROL_V1_H
#define WALKER_CONTROL_V1_H

#include "spadas.h"

namespace walker_control_v1
{
	using namespace spadas;

	struct WalkerControlData
	{
		Bool requestControl; // Weather to request control / 是否请求控制
		Double heading; // [deg] Heading of moving, 0 as north, CCW is positive / 行进朝向，0为正北，逆时针为正
		Double speed; // [KPH] Moving speed, 0 is static / 移动速度，0为静止

		WalkerControlData()
		{
			requestControl = FALSE;
			heading = 0;
			speed = 0;
		}
	};

	class WalkerControl : public Object<class WalkerControlVars>
	{
	public:
		SPADAS_TYPE("walker_control_v1.WalkerControl")

		WalkerControl();
		FullTimestamp& timestamp();
		WalkerControlData *operator ->();

		static String getProtocolName(UInt channel);
		SessionGeneralSample toGeneralSample();

		static Array<String> getProtocolNames(UInt channel);
		Bool fromGeneralSample(String protocol, SessionGeneralSample generalSample);
	};
}

#endif
